import { useSelector } from 'react-redux';
import { RootState } from '../store';
function useGetComponentInfo() {
  const components = useSelector((state: RootState) => state.components.present);
  const { componentList = [], selectedId = '', copiedComponent, undoStep } = components;
  const selectedComponent = componentList.find((component) => component.fe_id === selectedId);
  return { componentList, selectedId, selectedComponent, copiedComponent, undoStep };
}

export default useGetComponentInfo;
